<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>部门列表页面</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript">
		function checkDel(deptid){
			if(confirm("您真的要删除该部门么？")){
				location.href='deleteDept.action?deptid='+deptid;
			}
		}
	</script>
</head>
<style type="text/css">
td {
	text-align: center;
}

img {
	cursor: hand;
}
</style>
<body>
	<div>
		<h4 style="font-size:20px; color:#0000FF">系统管理>>部门列表</h4>
	</div>
	<input type="button" value="新增"
		onclick="location.href='toAddDept.action'">
	<br>
	<div align="center">
		<table border="2px;" bordercolor="#666666" width="600px">
			<tr style="background-color:#999999">
				<td>部门编号</td>
				<td>部门名称</td>
				<td>操作</td>
			<tr>
				<s:iterator value="deptList">
					<tr>
						<td><s:property value="id" /></td>
						<td><s:property value="name" /></td>
						<td><s:if test="userses.size() == 0">
								<img src="images/crete.jpg"
									onclick="location.href='updateDept.action?deptid=<s:property value="id" />'" />
								<img src="images/main.jpg"
									onclick="checkDel(<s:property value="id" />)" />
							</s:if> <s:else>
								<img src="images/crete.jpg"
									onclick="location.href='updateDept.action?deptid=<s:property value="id" />'" />
							</s:else>
						</td>
					<tr>
				</s:iterator>
		</table>
		<div align="center">
			<table>
				<tr>
					<td bgcolor="#00ffff" colspan="10" align="center">第<s:property
							value="pageBean.currentPage" />页 每页<s:property
							value="pageBean.perPage" /> 条记录 共<s:property
							value="pageBean.allPage" />页 共<s:property
							value="pageBean.allRecords" /> 条 <a
						href="findAllDept.action?page=<s:property value='pageBean.firstPage'/>">首页</a>
						<a
						href="findAllDept.action?page=<s:property value='pageBean.previousPage'/>">上一页</a>
						<a
						href="findAllDept.action?page=<s:property value='pageBean.nextPage'/>">下一页</a>
						<a
						href="findAllDept.action?page=<s:property value='pageBean.lastPage'/>">尾页</a>
					</td>
				</tr>
			</table>
		</div>
	</div>
</body>
</html>
